package com.inspector.app.ui.task;

import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.ViewModel;

import com.example.commen.net.easyHttp.EasyHttpManager;
import com.example.commen.net.easyHttp.model.HttpData;
import com.google.gson.Gson;
import com.hjq.http.listener.HttpCallback;

public class TaskExecutionDialogModel extends ViewModel {

    public void getPassword(LifecycleOwner lifecycleOwner, PasswordData passwordData, HttpCallback<HttpData<String>> httpDataHttpCallback) {
        String json = new Gson().toJson(passwordData);
        EasyHttpManager.get().post(lifecycleOwner, "/api/v2/cooperationTask/pass/input", json, httpDataHttpCallback);

    }

    public void getReason(LifecycleOwner lifecycleOwner, ReasonData reasonData, HttpCallback<HttpData<String>> httpDataHttpCallback) {
        String json = new Gson().toJson(reasonData);
        EasyHttpManager.get().post(lifecycleOwner, "/api/v1/cooperationTask/applyToJoin", json, httpDataHttpCallback);

    }

}
